home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / xlib.arc / lib_inst.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-12-07  |  527 b   |  27 lines

  1. /* Install a shared library */
  2.  
  3. #include <osbind.h>
  4. #include <bios.h>
  5. #include <basepage.h>
  6. #include "libs.h"
  7.  
  8. typedef void (*vproc)();
  9.  
  10.  
  11. /* Install this calling program as a shared library */
  12.  
  13. void
  14. InstallLibrary (lib,keep)
  15.   LibLink *lib;        /* IN link structure for the library to install */
  16.   long keep;        /* IN amount of memory to keep for library */
  17. {
  18.   extern int end[];
  19.   register vproc add_lib;
  20.   
  21.   if (add_lib = (vproc)Setexc(LIB_ADD_VECTOR,-1L))
  22.   {
  23.     (*add_lib)(lib);
  24.     Ptermres(keep+(long)end-(long)BP,0);
  25.   }
  26. }
  27.